com.rscja.team.qcom.deviceapi

## Class FingerprintWithFIPS_qcom

- java.lang.Object
- - com.rscja.team.qcom.deviceapi.Device_qcom
  - - com.rscja.team.qcom.deviceapi.FingerprintWithFIPS_qcom

- All Implemented Interfaces:
    IFingerprintWithFIPS

      public class FingerprintWithFIPS_qcom
      extends Device_qcom
      implements IFingerprintWithFIPS

  FIPS指纹识别模块操作类,
  FIPS fingerprint indentify module operation type,

  注意：
  Attention:
  1、使用前请确认您的机器已安装此模块。
  1. Make sure this module is installed before using.
  2、要正常使用模块需要在\libs\armeabi\目录放置libDeviceAPI.so文件
  2. Put libDeviceAPI.so file in directory \libs\armeabi\ then module can be used normally.
  3、在操作设备前需要调用 `init()` 打开设备，使用完后调用 `free()` 关闭设备
  3. Call `init()` to switch on device before operating, call `free()` to switch off device after using.

  Author:
    liuruifeng

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `decryption(byte[] originalBuf, int jdlen)` Deprecated.
    `byte[]` | `decryption(byte[] originalBuf, int jdlen, byte[] key)` Deprecated.
    `byte[]` | `decryption(byte[] originalBuf, int jdlen, java.lang.String key)` Deprecated.
    `int` | `deleteAllFingers()` 删除所有指纹信息 delete all fingerprint information
    `byte[]` | `Encryption(byte[] originalBuf, int jdlen)` Deprecated.
    `byte[]` | `Encryption(byte[] originalBuf, int jdlen, java.lang.String key)` Deprecated.
    `int` | `enroll()` 采集指纹 Acquire fingerprint
    `boolean` | `free()` 释放指纹模块 Release fingerprint module
    `boolean` | `generateImg(byte[] data, java.lang.String filePath)` 生成bmp图片 Generate bmp
    `int` | `getFingersCount()` 获取模块中采集的指纹数量 Acquire collected fingerprint amounts in module.
    `java.lang.String` | `getID()` 获取指纹ID Acquire fingerprint ID
    `static FingerprintWithFIPS_qcom` | `getInstance()` 获取指纹模块操作实例 Acquire fingerprint module operation Instance
    `FingerprintWithFIPS.FingerprintInfo` | `getPTInfo()` 获取模块信息 Acquire module information
    `int` | `grab()` 采集图像 Acquire image
    `boolean` | `init()` 初始化指纹模块 Initialize fingerprint module
    `boolean` | `init(android.content.Context mContext)` 初始化指纹模块 Initialize fingerprint module
    `int` | `ptCapture()` 获取指纹模版 Acquire fingerprint template
    `byte[]` | `ptConvertTemplateEx(FingerprintWithFIPS.DataFormat jtarget_type, byte[] srcbuf, int jsrclen)`
    `int` | `responseCancel()` 取消当前操作 Cancel current operation
    `byte[]` | `responseContinue()` 继续当前操作 Continue current operation
    `void` | `setEnrollCallBack(FingerprintWithFIPS.EnrollCallBack callBack)` 设置采集指纹回调接口 Setup call-back contact for acquiring fingerprint
    `void` | `setGrabCallBack(FingerprintWithFIPS.GRABCallBack callBack)` 设置获取图片回调接口 Setup call-back contact for acquiring picture
    `boolean` | `setID(java.lang.String hexID)` 设置指纹模块ID Setup fingerprint module ID
    `void` | `setIdentificationCallBack(FingerprintWithFIPS.IdentificationCallBack callBack)` 设置指纹验证回调接口 Setup fingerprint verification
    `void` | `setPtCaptureCallBack(FingerprintWithFIPS.PtCaptureCallBack callBack)` 设置获取指纹模版回调接口 Setup call-back contact for acquiring fingerprint template
    `void` | `setTemplateVerifyCallBack(FingerprintWithFIPS.TemplateVerifyCallBack callBack)` 设置模版比对回调接口 Setup call-back contact for template comparison
    `void` | `startEnroll()` 开始采集指纹,注意:请调用 start acquire fingerprint, attention: call out `#setEnrollCallBack(EnrollCallBack callBack)` 方法设置接收回调数据 `#setEnrollCallBack(EnrollCallBack callBack)`setup receviced call-back data
    `void` | `startGRAB()` 开始获取图片,注意:请调用 start acquire picture, attention: call out `#setGrabCallBack(GRABCallBack callBack)` 方法设置接收回调数据 `#setGrabCallBack(GRABCallBack callBack)`method to setup received call-back data.
    `void` | `startIdentification()` 开始验证指纹,注意:请调用 start verify finerprint, attention: call out `#setIdentificationCallBack(IdentificationCallBack callBack)` 方法设置接收回调数据 `#setIdentificationCallBack(IdentificationCallBack callBack)` setup receviced call-back data
    `void` | `startPtCapture()` 开始获取指纹模版,注意:请调用 Start acquire fingerprint template, attention: call up `#setPtCaptureCallBack(PtCaptureCallBack callBack)` 方法设置接收回调数据 `#setPtCaptureCallBack(PtCaptureCallBack callBack)` method to setup received call-back data.
    `void` | `startTemplateVerify(char[] template)` 开始模版验证,注意:请调用 start template verification, attention: call out `#setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)` 方法设置接收回调数据 `#setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)`method to setup received call-back data.
    `void` | `stopEnroll()` 停止采集指纹 Stop acquiring fingerprint
    `void` | `stopGRAB()` 停止获取图片 stop acquiring picture
    `void` | `stopIdentification()` 停止指纹验证 Stop fingerprint verification
    `void` | `stopPtCapture()` 停止获取指纹模版 Stop acquiring fingerprint template
    `void` | `stopTemplateVerify()` 停止模版比对 Stop template comparison
    `int` | `storeFinger(byte[] templateData)` 将指纹模板导入到指纹模块中
    `int` | `Verify(char[] data, int len)` 模版比对指纹,导入模版数据和当前指纹比对 Compare template and fingerprint, import template data and current fingerprint comparison.
    `int` | `verifyALL()` 验证指纹,验证当前指纹是否在指纹模块库里面存在 Verify fingerprint, verify current fingerprint exist in fingerprint library or not.

    - ### Methods inherited from class com.rscja.team.qcom.deviceapi.Device_qcom

      `isPowerOn`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.rscja.deviceapi.interfaces.IFingerprintWithFIPS

      `isPowerOn`

- - ### Method Detail

    - #### getInstance

          public static FingerprintWithFIPS_qcom getInstance()

      获取指纹模块操作实例
      Acquire fingerprint module operation Instance
      Returns:
        指纹模块操作实例
        return fingerprint operation Instance
      Throws:
        `ConfigurationException` - 配置错误异常
        Configuration error

    - #### init

          public boolean init(android.content.Context mContext)

      初始化指纹模块
      Initialize fingerprint module
      Specified by:
        `init` in interface `IFingerprintWithFIPS`
      Returns:
        true成功，false失败
        true means success, false means failed

    - #### init

          public boolean init()

      初始化指纹模块
      Initialize fingerprint module
      Specified by:
        `init` in interface `IFingerprintWithFIPS`
      Returns:
        true成功，false失败
        truen means success, false means failed

    - #### free

          public boolean free()

      释放指纹模块
      Release fingerprint module
      Specified by:
        `free` in interface `IFingerprintWithFIPS`
      Returns:
        true成功，false失败
        true means, false means failed

    - #### enroll

          public int enroll()

      采集指纹
      Acquire fingerprint
      Specified by:
        `enroll` in interface `IFingerprintWithFIPS`
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, other means operation failed.

    - #### verifyALL

          public int verifyALL()

      验证指纹,验证当前指纹是否在指纹模块库里面存在
      Verify fingerprint, verify current fingerprint exist in fingerprint library or not.
      Specified by:
        `verifyALL` in interface `IFingerprintWithFIPS`
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, other means operation failed.

    - #### Verify

          public int Verify(char[] data,
                            int len)

      模版比对指纹,导入模版数据和当前指纹比对
      Compare template and fingerprint, import template data and current fingerprint comparison.
      Specified by:
        `Verify` in interface `IFingerprintWithFIPS`
      Parameters:
        `data` - 模版数据
        data template data
        `len` - 数据长度
        len data length
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, others means operation failed

    - #### deleteAllFingers

          public int deleteAllFingers()

      删除所有指纹信息
      delete all fingerprint information
      Specified by:
        `deleteAllFingers` in interface `IFingerprintWithFIPS`
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, others means operation failed

    - #### storeFinger

          public int storeFinger(byte[] templateData)

      将指纹模板导入到指纹模块中
      Specified by:
        `storeFinger` in interface `IFingerprintWithFIPS`
      Parameters:
        `templateData` - 模板数据
      Returns:
        返回id; success: >=0 faile:-1

    - #### getFingersCount

          public int getFingersCount()

      获取模块中采集的指纹数量
      Acquire collected fingerprint amounts in module.
      Specified by:
        `getFingersCount` in interface `IFingerprintWithFIPS`
      Returns:
        指纹数量, 返回-1为获取失败
        return fingerprint amounts, return -1 means acquire failed

    - #### responseCancel

          public int responseCancel()

      取消当前操作
      Cancel current operation
      Specified by:
        `responseCancel` in interface `IFingerprintWithFIPS`
      Returns:
        0表示操作成功，其他值表示操作失败
        return 0 means operation success, others means operation failed

    - #### responseContinue

          public byte[] responseContinue()

      继续当前操作
      Continue current operation
      Specified by:
        `responseContinue` in interface `IFingerprintWithFIPS`
      Returns:
        索引0~4 是状态，4~8是后面数据的长度，8~12是指纹ID；如果是采集指纹，后面的数据就是指纹特征数据
        return index 0 to 4 means status, 4 to 8 means back data length, 8 to 12 means fingerprint ID, if it is acquired fingerprint, back data means fingerprint characteristic data.

    - #### grab

          public int grab()

      采集图像
      Acquire image
      Specified by:
        `grab` in interface `IFingerprintWithFIPS`
      Returns:
        0表示操作成功，其他值表示操作失败
        return 0 means operation success, others means operation failed

    - #### ptCapture

          public int ptCapture()

      获取指纹模版
      Acquire fingerprint template
      Specified by:
        `ptCapture` in interface `IFingerprintWithFIPS`
      Returns:
        0表示操作成功，其他值表示操作失败
        return 0 means operation success, others means operation failed

    - #### ptConvertTemplateEx

          public byte[] ptConvertTemplateEx(FingerprintWithFIPS.DataFormat jtarget_type,
                                            byte[] srcbuf,
                                            int jsrclen)

      Specified by:
        `ptConvertTemplateEx` in interface `IFingerprintWithFIPS`
      Parameters:
        `jtarget_type` - 转换后的格式类型
        param jtarget_type data format after transformed
        `srcbuf` - 转换之前的数据
        param srcbuf before transformed
        `jsrclen` - 转换之前的数据长度
        param jsrclen data length before transformed
      Returns:
        返回转换后的数据
        return transfered data

    - #### getPTInfo

          public FingerprintWithFIPS.FingerprintInfo getPTInfo()

      获取模块信息
      Acquire module information
      Specified by:
        `getPTInfo` in interface `IFingerprintWithFIPS`
      Returns:
        返回fips指纹模块信息
        return fips fingerprint module information

    - #### generateImg

          public boolean generateImg(byte[] data,
                                     java.lang.String filePath)

      生成bmp图片
      Generate bmp
      Specified by:
        `generateImg` in interface `IFingerprintWithFIPS`
      Parameters:
        `data` - 数据
        parame data
        `filePath` - 生成后图片保存的文件路径
        param filePath file indirectory after picture generated
      Returns:
        true 成功，false 失败
        return ture means success, false means failed

    - #### setID

          public boolean setID(java.lang.String hexID)

      设置指纹模块ID
      Setup fingerprint module ID
      Specified by:
        `setID` in interface `IFingerprintWithFIPS`
      Returns:
        设置成功返回ture，设置失败返回false
        setup success return ture, setup failed return false

    - #### getID

          public java.lang.String getID()

      获取指纹ID
      Acquire fingerprint ID
      Specified by:
        `getID` in interface `IFingerprintWithFIPS`
      Returns:
        返回指纹ID
        return fingerprint ID

    - #### startPtCapture

          public void startPtCapture()

      开始获取指纹模版,注意:请调用
      Start acquire fingerprint template, attention: call up
      `#setPtCaptureCallBack(PtCaptureCallBack callBack)` 方法设置接收回调数据
      `#setPtCaptureCallBack(PtCaptureCallBack callBack)` method to setup received call-back data.
      Specified by:
        `startPtCapture` in interface `IFingerprintWithFIPS`

    - #### startGRAB

          public void startGRAB()

      开始获取图片,注意:请调用
      start acquire picture, attention: call out
      `#setGrabCallBack(GRABCallBack callBack)` 方法设置接收回调数据
      `#setGrabCallBack(GRABCallBack callBack)`method to setup received call-back data.
      Specified by:
        `startGRAB` in interface `IFingerprintWithFIPS`

    - #### startTemplateVerify

          public void startTemplateVerify(char[] template)

      开始模版验证,注意:请调用
      start template verification, attention: call out
      `#setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)` 方法设置接收回调数据
      `#setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)`method to setup received call-back data.
      Specified by:
        `startTemplateVerify` in interface `IFingerprintWithFIPS`

    - #### startEnroll

          public void startEnroll()

      开始采集指纹,注意:请调用
      start acquire fingerprint, attention: call out
      `#setEnrollCallBack(EnrollCallBack callBack)` 方法设置接收回调数据
      `#setEnrollCallBack(EnrollCallBack callBack)`setup receviced call-back data
      Specified by:
        `startEnroll` in interface `IFingerprintWithFIPS`

    - #### startIdentification

          public void startIdentification()

      开始验证指纹,注意:请调用
      start verify finerprint, attention: call out
      `#setIdentificationCallBack(IdentificationCallBack callBack)` 方法设置接收回调数据
      `#setIdentificationCallBack(IdentificationCallBack callBack)` setup receviced call-back data
      Specified by:
        `startIdentification` in interface `IFingerprintWithFIPS`

    - #### stopGRAB

          public void stopGRAB()

      停止获取图片
      stop acquiring picture
      Specified by:
        `stopGRAB` in interface `IFingerprintWithFIPS`

    - #### stopEnroll

          public void stopEnroll()

      停止采集指纹
      Stop acquiring fingerprint
      Specified by:
        `stopEnroll` in interface `IFingerprintWithFIPS`

    - #### stopPtCapture

          public void stopPtCapture()

      停止获取指纹模版
      Stop acquiring fingerprint template
      Specified by:
        `stopPtCapture` in interface `IFingerprintWithFIPS`

    - #### stopTemplateVerify

          public void stopTemplateVerify()

      停止模版比对
      Stop template comparison
      Specified by:
        `stopTemplateVerify` in interface `IFingerprintWithFIPS`

    - #### stopIdentification

          public void stopIdentification()

      停止指纹验证
      Stop fingerprint verification
      Specified by:
        `stopIdentification` in interface `IFingerprintWithFIPS`

    - #### setGrabCallBack

          public void setGrabCallBack(FingerprintWithFIPS.GRABCallBack callBack)

      设置获取图片回调接口
      Setup call-back contact for acquiring picture
      Specified by:
        `setGrabCallBack` in interface `IFingerprintWithFIPS`
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setEnrollCallBack

          public void setEnrollCallBack(FingerprintWithFIPS.EnrollCallBack callBack)

      设置采集指纹回调接口
      Setup call-back contact for acquiring fingerprint
      Specified by:
        `setEnrollCallBack` in interface `IFingerprintWithFIPS`
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setPtCaptureCallBack

          public void setPtCaptureCallBack(FingerprintWithFIPS.PtCaptureCallBack callBack)

      设置获取指纹模版回调接口
      Setup call-back contact for acquiring fingerprint template
      Specified by:
        `setPtCaptureCallBack` in interface `IFingerprintWithFIPS`
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setIdentificationCallBack

          public void setIdentificationCallBack(FingerprintWithFIPS.IdentificationCallBack callBack)

      设置指纹验证回调接口
      Setup fingerprint verification
      Specified by:
        `setIdentificationCallBack` in interface `IFingerprintWithFIPS`
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setTemplateVerifyCallBack

          public void setTemplateVerifyCallBack(FingerprintWithFIPS.TemplateVerifyCallBack callBack)

      设置模版比对回调接口
      Setup call-back contact for template comparison
      Specified by:
        `setTemplateVerifyCallBack` in interface `IFingerprintWithFIPS`
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### Encryption

          @Deprecated
          public byte[] Encryption(byte[] originalBuf,
                                                int jdlen)

      Deprecated.
      目前不支持
      Not support
      Parameters:
        `originalBuf` - 加密之前的数据
        data before encrypted
        `jdlen` - 数据长度
        data length
      Returns:
        返回加密后的数据
        return encypted data

    - #### Encryption

          @Deprecated
          public byte[] Encryption(byte[] originalBuf,
                                                int jdlen,
                                                java.lang.String key)

      Deprecated.
      目前不支持
      Not support
      Parameters:
        `originalBuf` - 加密之前的数据
        data before encrypted
        `jdlen` - 数据长度
        data length
        `key` - 秘钥
        key
      Returns:
        返回加密后的数据
        return encypted data

    - #### decryption

          @Deprecated
          public byte[] decryption(byte[] originalBuf,
                                                int jdlen)

      Deprecated.
      目前不支持
      Not supported
      Parameters:
        `originalBuf` -
        `jdlen` -
      Returns:

    - #### decryption

          @Deprecated
          public byte[] decryption(byte[] originalBuf,
                                                int jdlen,
                                                java.lang.String key)

      Deprecated.
      目前不支持
      Not supported
      Parameters:
        `originalBuf` - 要解密的原始数据
        original data that need to be decoded
        `jdlen` - 数据长度
        data length
        `key` - 秘钥
        key
      Returns:
        返回解密后的数据
        return decoded data

    - #### decryption

          @Deprecated
          public byte[] decryption(byte[] originalBuf,
                                                int jdlen,
                                                byte[] key)

      Deprecated.
      目前不支持
      Not support
      Parameters:
        `originalBuf` -
        `jdlen` -
        `key` -
      Returns: